<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .section {
      font-size: 50px;
      text-align: center;
    }
  </style>
  <link rel="stylesheet" href="./fullpage/fullpage.min.css">
  <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  <script src="./fullpage/fullpage.min.js"></script>
</head>
<body>
  <div id="fullpage">
    <div class="section">第一页</div>
    <div class="section">
      <div class="slide"> 第二页-1 </div>
      <div class="slide"> 第二页-2 </div>
      <div class="slide"> 第二页-3 </div>
      <div class="slide"> 第二页-4 </div>
    </div>
    <div class="section">第三页</div>
    <div class="section">第四页</div>
  </div>  
  <script>
    // 初始化fullPage
    $(document).ready(function() {
      $('#fullpage').fullpage({
        css3: true,
        easingcss3: 'ease'
      });
    });

    // 随机匹配颜色
    $(".section").each((i, it) => {
      $(it).css("backgroundColor", radomColor)
    });
    $(".section .slide").each((i, it) => {
      $(it).css("backgroundColor", radomColor)
    });


    function radomColor() {
      return "#" + (Math.random().toString()).slice(-6)
    }
  </script>
</body>
</html>